package org.example.chain;

import org.example.model.FarmMachine;

public class RemoteAlertHandler extends SafetyHandler {
    @Override
    public void handleSafetyEvent(FarmMachine machine, String event, SafetyData data) {
        if ("检测到故障".equals(event) || "紧急情况".equals(event)) {
            System.out.println("远程报警处理器处理事件: " + event);
            System.out.println("发送警报至控制中心: " + machine.getType() + "[" + machine.getId() + "] 发生" + data.getFaultInfo());
            System.out.println("警报已发送，等待响应...");
        } else if (nextHandler != null) {
            nextHandler.handleSafetyEvent(machine, event, data);
        }
    }
}